// ============================================================================
//
// LCP-net framework by Pierre CHATEL chatelp@gmail.com
// Distributed under GPLv3
// Copyright (C) THALES Land & Joint Systems, 2008, 2009. All rights reserved
//
// ============================================================================

/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package com.thalesgroup.preferenceFramework.models.LCPnet.util;

import com.thalesgroup.preferenceFramework.models.Arc;

import com.thalesgroup.preferenceFramework.models.LCPnet.*;

import com.thalesgroup.preferenceFramework.models.Namable;
import com.thalesgroup.preferenceFramework.models.Node;
import com.thalesgroup.preferenceFramework.models.NodeValue;
import com.thalesgroup.preferenceFramework.models.Outcome;
import com.thalesgroup.preferenceFramework.models.PreferenceNetwork;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see com.thalesgroup.preferenceFramework.models.LCPnet.LCPnetPackage
 * @generated
 */
public class LCPnetSwitch<T> {
	/**
	 * The cached model package
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static LCPnetPackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LCPnetSwitch() {
		if (modelPackage == null) {
			modelPackage = LCPnetPackage.eINSTANCE;
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	public T doSwitch(EObject theEObject) {
		return doSwitch(theEObject.eClass(), theEObject);
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(EClass theEClass, EObject theEObject) {
		if (theEClass.eContainer() == modelPackage) {
			return doSwitch(theEClass.getClassifierID(), theEObject);
		}
		else {
			List<EClass> eSuperTypes = theEClass.getESuperTypes();
			return
				eSuperTypes.isEmpty() ?
					defaultCase(theEObject) :
					doSwitch(eSuperTypes.get(0), theEObject);
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case LCPnetPackage.LC_PNET: {
				LCPnet lcPnet = (LCPnet)theEObject;
				T result = caseLCPnet(lcPnet);
				if (result == null) result = casePreferenceNetwork(lcPnet);
				if (result == null) result = caseNamable(lcPnet);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.LINGUISTIC_DOMAIN: {
				LinguisticDomain linguisticDomain = (LinguisticDomain)theEObject;
				T result = caseLinguisticDomain(linguisticDomain);
				if (result == null) result = caseNamable(linguisticDomain);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.LINGUISTIC_SUBSET: {
				LinguisticSubset linguisticSubset = (LinguisticSubset)theEObject;
				T result = caseLinguisticSubset(linguisticSubset);
				if (result == null) result = caseNamable(linguisticSubset);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.LNODE: {
				LNode lNode = (LNode)theEObject;
				T result = caseLNode(lNode);
				if (result == null) result = caseNode(lNode);
				if (result == null) result = caseNamable(lNode);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.CLPT: {
				CLPT clpt = (CLPT)theEObject;
				T result = caseCLPT(clpt);
				if (result == null) result = caseNamable(clpt);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.CLPT_LINE: {
				CLPTLine clptLine = (CLPTLine)theEObject;
				T result = caseCLPTLine(clptLine);
				if (result == null) result = caseNamable(clptLine);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.CNODE_VALUE: {
				CNodeValue cNodeValue = (CNodeValue)theEObject;
				T result = caseCNodeValue(cNodeValue);
				if (result == null) result = caseNodeValue(cNodeValue);
				if (result == null) result = caseNamable(cNodeValue);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.LNODE_VALUE: {
				LNodeValue lNodeValue = (LNodeValue)theEObject;
				T result = caseLNodeValue(lNodeValue);
				if (result == null) result = caseNodeValue(lNodeValue);
				if (result == null) result = caseNamable(lNodeValue);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.LNODE_VALUE_UTILITY: {
				LNodeValueUtility lNodeValueUtility = (LNodeValueUtility)theEObject;
				T result = caseLNodeValueUtility(lNodeValueUtility);
				if (result == null) result = caseNamable(lNodeValueUtility);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.COORDINATE: {
				Coordinate coordinate = (Coordinate)theEObject;
				T result = caseCoordinate(coordinate);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.COUTCOME: {
				COutcome cOutcome = (COutcome)theEObject;
				T result = caseCOutcome(cOutcome);
				if (result == null) result = caseOutcome(cOutcome);
				if (result == null) result = caseNamable(cOutcome);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.LTWO_TUPLE: {
				LTwoTuple lTwoTuple = (LTwoTuple)theEObject;
				T result = caseLTwoTuple(lTwoTuple);
				if (result == null) result = caseNamable(lTwoTuple);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.IARC: {
				IArc iArc = (IArc)theEObject;
				T result = caseIArc(iArc);
				if (result == null) result = caseArc(iArc);
				if (result == null) result = caseNamable(iArc);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.CI_ARC: {
				CIArc ciArc = (CIArc)theEObject;
				T result = caseCIArc(ciArc);
				if (result == null) result = caseArc(ciArc);
				if (result == null) result = caseNamable(ciArc);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.CIT: {
				CIT cit = (CIT)theEObject;
				T result = caseCIT(cit);
				if (result == null) result = caseNamable(cit);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case LCPnetPackage.CIT_LINE: {
				CITLine citLine = (CITLine)theEObject;
				T result = caseCITLine(citLine);
				if (result == null) result = caseNamable(citLine);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>LC Pnet</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>LC Pnet</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLCPnet(LCPnet object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Linguistic Domain</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Linguistic Domain</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLinguisticDomain(LinguisticDomain object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Linguistic Subset</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Linguistic Subset</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLinguisticSubset(LinguisticSubset object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>LNode</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>LNode</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLNode(LNode object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>CLPT</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>CLPT</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCLPT(CLPT object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>CLPT Line</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>CLPT Line</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCLPTLine(CLPTLine object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>CNode Value</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>CNode Value</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCNodeValue(CNodeValue object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>LNode Value</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>LNode Value</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLNodeValue(LNodeValue object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>LNode Value Utility</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>LNode Value Utility</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLNodeValueUtility(LNodeValueUtility object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Coordinate</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Coordinate</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCoordinate(Coordinate object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>COutcome</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>COutcome</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCOutcome(COutcome object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>LTwo Tuple</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>LTwo Tuple</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLTwoTuple(LTwoTuple object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>IArc</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>IArc</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseIArc(IArc object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>CI Arc</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>CI Arc</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCIArc(CIArc object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>CIT</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>CIT</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCIT(CIT object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>CIT Line</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>CIT Line</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCITLine(CITLine object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Namable</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Namable</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseNamable(Namable object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Preference Network</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Preference Network</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T casePreferenceNetwork(PreferenceNetwork object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Node</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Node</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseNode(Node object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Node Value</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Node Value</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseNodeValue(NodeValue object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Outcome</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Outcome</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseOutcome(Outcome object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Arc</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Arc</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseArc(Arc object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	public T defaultCase(EObject object) {
		return null;
	}

} //LCPnetSwitch
